import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

/* 基础布局组件 */ 
import Layout from "@/layout/index.vue"

const routes:RouteRecordRaw[] = [
    {
        path:'/login',
        name:'Login',
        component:()=> import('@/views/Login/index.vue'),
        meta: { hidden: true, title: '登录' },
    },
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: '/community-search',
        meta: { title: '信息查询', icon: 'system', alwaysShow: true },
        children: [
          {
            path: 'community-search',
            name: 'CommunitySearch',
            component: () => import('@/views/Search/CommunitySearch/index.vue'),
            meta: { title: '社区查询', icon: 'Search' },
          },
          {
            path: 'house-search',
            name: 'HouseSearch',
            component: () => import('@/views/Search/HouseSearch/index.vue'),
            meta: { title: '房屋查询', icon: 'Search' },
          },
        ],
    }
]

export default createRouter({
    history:createWebHistory(),
    routes
})